﻿using Easy.Services.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Easy.Services.Config
{
    internal class PermissionConfig : IEntityTypeConfiguration<Permission>
    {
        public void Configure(EntityTypeBuilder<Permission> builder)
        {
            builder.ToTable(nameof(Permission));
  
            builder.Property(r => r.CreaterDate);
            builder.Property(r => r.CreaterId).IsRequired(false);
            builder.Property(r => r.CreaterName).HasMaxLength(50).IsRequired(false);
            builder.Property(r => r.Code).IsRequired(false);
            builder.Property(r => r.Description).HasMaxLength(500).IsRequired(false);
            builder.Property(r => r.EditDate).IsRequired(false);
            builder.Property(r => r.EditId).IsRequired(false);
            builder.Property(r => r.EditName).HasMaxLength(50).IsRequired(false);
            builder.Property(r => r.IsDelete).IsRequired(false);

            builder.Property(r => r.Name).HasMaxLength(100);

        }
    }
}
